package com.hatricks.is.capturecode;

import com.hatricks.is.exceptionstrace.BizException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @packageName: com.hatricks.is.capturecode
 * @className: TemplateEnums
 * @author: yanyuhui y568821795@outlook.com
 * @date: 2024-12-03 14:33
 * @description: 模板枚举
 */
@AllArgsConstructor
@Getter
public enum TemplateEnums {
    LOGIN_TEMPLATE("login", "SMS_475955484", "登录场景模板"),
    FORGET_PASSWORD_TEMPLATE("forgetPassword", "SMS_475750550", "忘记密码场景模板"),
    ;

    private final String name;
    private final String value;
    private final String desc;


    public static TemplateEnums getByName(String name) {
        for (TemplateEnums templateEnum : TemplateEnums.values()) {
            if (templateEnum.getName().equals(name)) {
                return templateEnum;
            }
        }
        throw new BizException("当前未识别的操作场景");
    }
}
